<template>
  <header class="nav">
    <span class="iconfont" v-if="!value" @click="toggle">&#xe790;</span>
    <span class="iconfont" v-else @click="toggle">&#xe622;</span>
    <h3>聊天区</h3>
    <span class="iconfont apple">&#xe6b3;</span>
  </header>
</template>

<script>
export default {
  name: 'ChatNav',
  data() {
    return {
    }
  },
  props: {
    value: true
  },
  methods: {
    toggle() {
      this.$emit("input",!this.value)
    }
  }
}
</script>

<style lang="scss" scoped>
.nav {
  display: flex;
  padding: 10px;
  justify-content: space-between;
  align-items: center;
  height: 30px;
  border-bottom: 1px solid #ccc;

  .iconfont {
    color: black;
    cursor: pointer;
    user-select: none;
  }

  .apple {
    color: rgb(106, 255, 0);
  }

  @media (max-width: 800px) {
    background-color: #202123;
    height: 50px;
    color: white;
    padding: 10px 15px;

    .iconfont {
      font-size: 20px;
      color: white;
    }

    .apple {
      color: orange;
    }
  }
}
</style>